package ooday5;
//枚举演示
public class EnumDemo {
    public static void main(String[] args) {
       Season[] s=Season.values();//获取枚举所有对象
        for (int i = 0; i < s.length; i++) {
            System.out.println(s[i]);
            System.out.println(s[i].getSeasonDesc());//季节描述
            System.out.println(s[i].getSeasonName());
        }
        //获取单个对象
        Season season=Season.valueOf("SPRING");
        Season b=Season.SUMMER;//和上面一样
        switch (b){//排序配合枚举使用
            case SUMMER:
                System.out.println(b.getSeasonName()+"很"+b.getSeasonDesc());
                break;
            case SPRING:
                System.out.println(b.getSeasonName()+"很"+b.getSeasonDesc());
            case AUTUMN:
                System.out.println(b.getSeasonName()+"很"+b.getSeasonDesc());
                break;
            case WINTER:
                System.out.println(b.getSeasonName()+"很"+b.getSeasonDesc());
                break;
            default:
        }

    }
}
